package com.startup.yellocar.service.impl;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.startup.yellocar.dto.TransactionDTO;
import com.startup.yellocar.dao.TransactionDAO;

import com.startup.yellocar.service.TransactionService;

@Service
@Transactional
public class TransactionServiceImpl implements TransactionService {

	@Autowired
	protected TransactionDAO transactionDAO;

	@Transactional
	public void insert(TransactionDTO transactionDTO){
		transactionDAO.insert(transactionDTO);
	}

	@Transactional
	public void update(TransactionDTO transactionDTO){
		transactionDAO.update(transactionDTO);
	}

	@Transactional
	public TransactionDTO get(int id) {
		return transactionDAO.get(id);
	}

	@Transactional
	public List<TransactionDTO> getAll() {
		return transactionDAO.getAll();
	}

	@Transactional
	public void delete(TransactionDTO transactionDTO){
		transactionDAO.delete(transactionDTO);
	}

}
